﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace RegisterationCommon.Common
{
    public class SysSet
    {
        /// <summary>
        /// 判断登记时间是否截止
        /// </summary>
        /// <returns></returns>
        public static bool IsStopSignUp()
        {
            bool res = false;
            DataTable dt = DBAction.GetDTFromSQL("select * from Sys_Set");
            if (dt.Rows.Count > 0)
            {
                if ((bool)dt.Rows[0]["IsStopSignUp"])
                {
                    if (!string.IsNullOrEmpty(dt.Rows[0]["StopSignUpDateTime"].ToString()))
                    {
                        DateTime dtEnd = Convert.ToDateTime(dt.Rows[0]["StopSignUpDateTime"].ToString());
                        TimeSpan ts = DateTime.Now.Subtract(dtEnd);
                        if (ts.TotalSeconds >= 0)
                        {
                            res = true;
                        }
                    }
                }
            }
            return res;
        }

    }
}
